package com.atomy.bigeventsservice.service.impl;

import com.atomy.bigeventsservice.entity.User;
import com.atomy.bigeventsservice.map.UserMapper;
import com.atomy.bigeventsservice.service.UserServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServerImpl implements UserServer {
    @Autowired
    private UserMapper userMapper;
    @Override
    public User login(User user) {
        return userMapper.login(user);
    }

    @Override
    public User register(User user) {
        User u=userMapper.searchUser(user);
        if (u!=null)
            return null;
        userMapper.insert(user);
        return new User();//仅仅作为成功的一种响应 后期优化
    }
}
